<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script>
    $(document).ready(function(){
    	searchListForm();
    });
    
   //检索 
   function searchListForm() {
	    var actionPath = ""
	    // 采购手册页面
	    if($("#indentSelectFlg").val()=="handbook"){
	    	actionPath = "${ctx}/purchase/handbook/searchIndentList"
	    }else if ($("#indentSelectFlg").val()=="productionNotice") {
	    	actionPath = "${ctx}/produce/notice/searchIndentList";
	    }else{
	    	actionPath = "${ctx}/customization/nuclearmaterial/searchIndentList";
	    }
    	var params = $("#searchForm").serialize();
    	$("#activity_pane").showLoading();
		$.post(actionPath,params, function(result) {
			var listHtml = result["indent"];
			var pageHtml = result["page"];
			$("#listHtml").html(listHtml);
			$("#paging").html(pageHtml);
			$("#activity_pane").hideLoading();
		}, 'json');
	} 
            
    function selectIndent() {
    	//获取 iframe 数量 
    	var frLength = window.parent.frames.length;
    	//父画面下标  
    	var parentIndex = frLength-2;
    	var indentId = $("#listHtml tr.trSelected").find(".indentId").val();
    	if(window.parent.frames[parentIndex].selectIndentCallBack && typeof(window.parent.frames[parentIndex].selectIndentCallBack) == "function"){
    		window.parent.frames[parentIndex].selectIndentCallBack(indentId);
		}else if(window.parent.frames[parentIndex+1].selectIndentCallBack && typeof(window.parent.frames[parentIndex+1].selectIndentCallBack) == "function"){
			window.parent.frames[parentIndex+1].selectIndentCallBack(indentId);
		}
        closeWin(); 
	}
    
    //选择按钮事件
    function selectFunction(obj){
    	$("#listHtml tr").removeClass('trSelected');
    	$(obj).addClass('trSelected');
    	
    }
    
	 //重置
	function clean() {
		 $("#customerIndentNo").val("");
		 $("#styleCustomerNo").val("");
		 $("#ognizationName").val("");
		 searchListForm();
	}    
    </script>
    
</head>
<body>
<form id="searchForm">
<input type="hidden" id="indentSelectFlg" name="indentSelectFlg" value="${orderMateriel.indentSelectFlg}"/>
<div class="layerHeader clearfix" style="width: 800px">
	<p class="headerTitle"><spring:message code="indent_select_head" /></p>
	<div class="headerButton clearfix">
                <button type="button" onclick="searchListForm();"><spring:message code="commom_check" /></button>
                <button type="button" onclick="clean();"><spring:message code="common_reset" /></button>
                <button type="button" onclick="selectIndent();"><spring:message code="style_selectOK" /></button>
                <button type="button" onclick="closeWin();"><spring:message code="btn_cancle" /></button>
    </div>
</div>
<div class="listArea" style="width: 800px" id="activity_pane">
	<div class="listBg">
	    <div class="searchArea clearfix">
            <div class=" clearfix">
                <!-- 客户合同号 -->
                <div class="searchInp clearfix">
                    <p><spring:message code="indent_select_customerIndentNo" /></p>
                    <input type="text" id="customerIndentNo" name="customerIndentNo">
                </div>
                <!-- 客户款号 -->
                <div class="searchInp clearfix">
                    <p><spring:message code="indent_select_styleCustomerNo" /></p>
                    <input type="text" id="styleCustomerNo" name="styleCustomerNo">
                </div>
                <!-- 客户名称 -->
                <div class="searchInp clearfix items">
                    <p><spring:message code="indent_select_ognizationName" /></p>
                    <input type="text" id="ognizationName" name="ognizationName">
                </div>
            </div>
        </div>
	
        <div class="tableArea tabBoxSm" >
            <div class="tableScroll tabSm" style="overflow: auto;height: 357px;width:767px;">
                <table cellpadding="0" class="tableHead " >
                    <thead>
                    <tr>
                        <th><p style="width:30px;"><spring:message code="indent_select_no" /></p></th>
                        <th><p style="width:150px;"><spring:message code="indent_select_customerIndentNo" /></p></th>
                        <th><p style="width:150px;"><spring:message code="indent_select_indentNo" /></p></th>	
                        <th><p style="width:90px;"><spring:message code="indent_select_ognizationName" /></p></th>
                        <th><p style="width:60px;"><spring:message code="indent_select_styleCateGory" /></p></th>
                        <th><p style="width:110px;"><spring:message code="indent_select_styleCustomerNo" />/<spring:message code="indent_select_styleNameCn" /></p></th>
                        <th><p style="width:70px;"><spring:message code="indent_select_indentQuantity" /></p></th>
                        <th><p style="width:80px;"><spring:message code="indent_select_indentDeliveryDate" /></p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody" >              
                    <tbody id = "listHtml">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id = "paging" ></div>
</div>
</form>
</body>
</html>